using System;

namespace Core.Demo3
{
	public class Employee
	{
		public double HourlyRate { get; set; }
		public Guid Id { get; set; }
		public string Name { get; set; }
		public Timesheet[] Timesheets { get; set; }

		public void Pay()
		{
			double amountTobePaid = 0;
			foreach (var timesheet in Timesheets)
			{
				amountTobePaid += HourlyRate*timesheet.Hours;
			}
			var paymentService = new PaymentService();
			paymentService.Pay(this, DateTime.Now, amountTobePaid);
		}

		//Wrap Method
//		public void Pay()
//		{
//			DispatchPay();
//			LogPayment();
//		}
//
//		public void DispatchPay()
//		{
//			double amountTobePaid = 0;
//			foreach (var timesheet in Timesheets)
//			{
//				amountTobePaid += HourlyRate * timesheet.Hours;
//			}
//			var paymentService = new PaymentService();
//			paymentService.Pay(this, DateTime.Now, amountTobePaid);
//		}
//
//		private void LogPayment()
//		{
//			//Write to log file
//		}
	}

	public class Timesheet
	{
		public int Hours { get; set; }
	}

	public class PaymentService
	{
		public void Pay(Employee employee, DateTime dateTime, double amountTobePaid)
		{
			// wire transfer 
		}
	}

	
	//Wrap Class, Decorator 
	public class LoggingEmployee : Employee
	{
		
	}
}
